//
//  def_parameter_list.h
//  compilation
//
//  Created by Kevin Le perf on 17/01/12.
//  Copyright (c) 2012 e2co technologie. All rights reserved.
//

#ifndef compilation_def_parameter_list_h
#define compilation_def_parameter_list_h

/*
 parameter_list
 : parameter_declaration {printf("parameter_list\n");}
 | parameter_list ',' parameter_declaration {printf("parameter_list\n");}
 ; 
 */
struct def_parameter_list{
	void * parent;
	int type;
	struct def_parameter_declaration * parameter_declaration;
	struct def_parameter_list * parameter_list;
};

struct def_parameter_list * parameter_list_create(void * parent){
	struct def_parameter_list * s = malloc(sizeof(*s));
	s->type = 0;
	s->parent = parent;
	return s;
}

void parameter_list_print(struct def_parameter_list * s){
	switch(s->type){
		case 2:
			parameter_list_print(s->parameter_list);
			printf(", ");
		case 1:
			parameter_declaration_print(s->parameter_declaration);
			break;
	}
}
#endif
